/***************************************************************************
 *   Copyleft 2006-2007 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#include "./Cursor3DManager.h"
#include "../Engine3D.h"

/**************************************************************
* Constructors                                                *
***************************************************************/
Cursor3DManager::Cursor3DManager(Cursor3D* cursor) {
	mCursor = cursor;
}
    
/**************************************************************
* Operators                                                   *
***************************************************************/


/**************************************************************
* Other helpful functions                                     *
***************************************************************/
/*virtual*/ cVoid Cursor3DManager::OnMouseMove(cPoint point, Engine3D* engine) {
	::SetCursor(cNull);	

 	mCursor->SetWorldPosition(Point4D((cFloat) point.x, (cFloat)-point.y, 0.0f), 
		engine->GetWorldMatrix(), Matrix4D::Perspective(engine->GetFOV()));
}

/*virtual*/ cVoid Cursor3DManager::OnMouseWheel(cInt iDelta, Engine3D* engine) {
	::SetCursor(cNull);

	mCursor->SetWorldPosition(Point4D((cFloat) iDelta, 0.0f, 0.0f), 
		engine->GetWorldMatrix(), Matrix4D::Perspective(engine->GetFOV()), true);

}